/* 
	该文件专门为Count组件生成action对象
*/
//引入定义的常量constant
import {INCREMENT,DECREMENT} from './constant'
import countReducer from "../../4_src_异步action版/redux/count_reducer";

/*createIncrementAction原型是这样的：
*  function createIncrementAction (data) {
       return {type:'increment',data;data}
}
箭头函数形式：  const createIncrementAction = (data) =>{
    return {type:'increment',data;data}
}
如果action使用箭头函数定义 则
        //store.dispatch分发type和data给reducer处理
        store.dispatch(()=>{createIncrementAction(value*1)})
        //引入redux-thunk，用于支持异步action
            import thunk from 'redux-thunk'
            //暴露store
        export default createStore(countReducer,applyMiddleware(thunk))
* */
export const createIncrementAction = data => ({type:INCREMENT,data})
export const createDecrementAction = data => ({type:DECREMENT,data})
